import { GlobalStyle } from './style';
import { IconStyle } from './assets/iconfont/iconfont'
import routes from './routes/index.js';
import { Provider } from 'react-redux'
import { useRoutes } from "react-router-dom";
import { Data } from './application/Singers/data';
import store from './store/index'

import { HashRouter as Router } from "react-router-dom";
// import { renderRoutes } from 'react-router-config';//renderRoutes 读取路由配置转化为 Route 标签
function GetRoutes() {
  return useRoutes(routes)
}
function App(props) {

  return (
    <div className="App">
      <Provider store={store}>
        <Router>
          {/* 通过标签形式引入这些初始化样式 */}
          <GlobalStyle></GlobalStyle>
          {/* 通过标签形式引入iconfont字体样式 */}
          <IconStyle></IconStyle>
          <Data>
            <GetRoutes />
          </Data>
        </Router>
      </Provider>
    </div>
  );
}

export default App;
